package AcWing周赛;

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: a
 * Date: 2022-08-27
 * Time: 19:16
 */
public class Demo66_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        int len = s.length();
        char[] str = new char[len];
        for(int i = 0; i < len; i++){
            str[i] = s.charAt(i);
        }
        Set<Character> set = new HashSet<>();
        char[] cs = new char[26];
        for(int i = 25; i < len; i++){
            set.clear();
            boolean flag = true;
            for(int j = i - 25; j <= i; j++){
                if(str[j] != '?' && set.contains(str[j])){
                    flag = false;
                    break;
                }else{
                    set.add(str[j]);
                }
            }
            if(flag){
                int k = 0;
                for(char ch = 'A'; ch <= 'Z'; ch++){
                    if(!set.contains(ch)){
                        cs[k++] = ch;
                    }
                }
                for(int j = i - 25, h = 0; j <= i; j++){
                    if(str[j] == '?'){
                        str[j] = cs[h++];
                    }
                }
                for(char c : str){
                    if(c == '?'){
                        c = 'A';
                    }
                    System.out.print(c);
                }
                System.out.println();
                return;
            }
        }
        System.out.println("-1");
    }
}
